package com.jdz.service.impl;

import com.google.common.collect.Lists;
import com.jdz.common.ServerResponse;
import com.jdz.dao.InstituteMapper;
import com.jdz.pojo.Institute;
import com.jdz.service.IInstituteService;

import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by sun
 **/
@Service("IInstituteService")
public class InstituteServiceImpl implements IInstituteService {
    @Autowired
    InstituteMapper instituteMapper;

    private Logger logger = LoggerFactory.getLogger(InstituteServiceImpl.class);


//    private InstituteVo assembleInstituteVo(Institute institute){
//        InstituteVo instituteVo = new InstituteVo();
//        instituteVo.setStuinstitutename(institute.getStuinstitutename());
//        return instituteVo;
//    }

    @Override
    public ServerResponse list() {

        List<Institute> instituteList = instituteMapper.selectList();
        if(CollectionUtils.isEmpty(instituteList)){
            logger.info("未找到学院");
        }


        return ServerResponse.createBySuccess(instituteList);
    }
}
